﻿using Sino.CapacityCloud.WebApi;
using Sino.Tms.Primitives;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;

namespace Sino.CapacityCloud.Repositories.Models
{

    public class Car
    {

        [Key()]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public string CarId { get; set; }

        public string CarrierId { get; set; }

        public string AddingCommitId { get; set; }

        public string Code { get; set; }

        public VehicleType Type { get; set; }

        public CarriageType CarriageType { get; set; }

        public CarLength Length { get; set; }

        public double AssignmentOfLoad { get; set; }

        public string Rank { get; set; }

        public DateTime? Date { get; set; }

        public string State { get; set; }

        public bool IsEnabled { get; set; }

        public string Origin { get; set; }

        public bool? CanTargeted { get; set; }

        public string VehicleLicenseKey { get; set; }

        public CertificationStatus CertificationStatus { get; set; }

        public string TrailerLicenseKey { get; set; }

        public CertificationStatus TrailerLicenseCertificationStatus { get; set; }

        public string VehiclePhotoKey { get; set; }

        public CertificationStatus VehiclePhotoCertificationStatus { get; set; }

        public string Remarks { get; set; }

        public virtual Carrier Carrier { get; set; }

        public virtual CarAddingModerationCommit AddingCommit { get; set; }

        public virtual ICollection<Location> Locations { get; set; }

        public virtual ICollection<ApplicationUser> Users { get; set; }

        public Car()
        {
            this.CarId = Guid.NewGuid().ToString();
            this.Locations = new List<Location>();
            this.Users = new List<ApplicationUser>();
        }

    }

}